package filehomework;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class test05 {
    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in);
        while(true){
            System.out.println("请输入文件名");
            File file = new File("./src/filehomework/"+scanner.nextLine());
            if(file.isFile()){
                System.out.println("该文件已重复");
            }
            else {
                file.createNewFile();
                System.out.println("创建成功！！！");
                break;
            }

        }
    }
}
